Regression - Forecasting and Predicting

by: m0rtal, 8 years ago


Walking through this module https://pythonprogramming.net/forecasting-predicting-machine-learning-tutorial/ I've stumbled upon error.
The code in this lecture is not giving prediction for the future prices, but for the past prices - look here: http://i91.fastpic.ru/big/2017/0220/f4/07db42f3d9fbcd3d0a7835ef8e8567f4.png

I've tested this on 125 different data sets, they are all the same. It's ~90% accuracy that makes them look "different". Take a look here for the various charts: yadi.sk/d/2P7TSsHC3BfnPa

So, how can we fix this?



You must be logged in to post. Please login or register an account.



This is addressed in a future part of the series, I think part 12 or so.

-Harrison 8 years ago

You must be logged in to post. Please login or register an account.


Yeah, I've seen it already... it does not ))
I've started stackoverflow thread to address the issue: http://stackoverflow.com/questions/42341208/linear-regression-accuracy-95-but-predicts-past-data

To clear things up: X_lately contains prices for last N days (till today). Algo should predict future N days, but it predicts same last N days no matter what. And that's the problem.

-m0rtal 8 years ago

You must be logged in to post. Please login or register an account.


The main problem is that we havin extreme autocorrelation betveen 'close' and 'label' - around 97%, so for prediction next N prices will be basically be 'close'[:-N] * 0.97

-m0rtal 8 years ago

You must be logged in to post. Please login or register an account.